<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        /* .f{
            width: 200px;
            height: 200px;
            background-color: aquamarine;
            margin: auto;
            /* position: relative;相对定位，相对于自身位置进行偏移 
            position: relative;
            top:100px;
            left: 100px;
        } */

        .gf {
            position: relative;
        }

        .ff {
            width: 400px;
            height: 700px;
            background-color: greenyellow;
            margin: auto;
            position: relative;
        }

        .s {
            width: 200px;
            height: 200px;
            background-color: rgb(65, 158, 100);
            /* margin: auto; */
            /* absolute:绝对定位 */
            /* position: absolute;
            top: 200px;
            left: 200px; */

            position: relative;
            
        }
    </style>
</head>

<body>
    <div class="f">

    </div>

    <div class="gf">
        <div class="ff">
            <div class="s">

            </div>
        </div>
    </div>
</body>

</html>